package com.esri.core.ogc.wmts;

import com.esri.core.internal.tasks.e.b.b;
import com.esri.core.internal.tasks.e.b.c;
import com.esri.core.io.UserCredentials;
import com.esri.core.portal.WebMapLayer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* loaded from: classes.dex */
public class WMTSServiceInfo {
    private Map<String, WMTSLayerInfo> a = new HashMap();
    private Map<String, WMTSTileMatrixSet> b = new HashMap();
    private String c;
    private String d;
    private String e;
    private String f;
    private String g;

    public WMTSServiceInfo(WebMapLayer webMapLayer) {
        a(webMapLayer);
    }

    public WMTSServiceInfo() {
    }

    public static WMTSServiceInfo fetch(String str) throws Exception {
        return fetch(str, null, WMTSServiceMode.REST);
    }

    public static WMTSServiceInfo fetch(String str, UserCredentials userCredentials) throws Exception {
        return fetch(str, userCredentials, WMTSServiceMode.REST);
    }

    public static WMTSServiceInfo fetch(String str, UserCredentials userCredentials, WMTSServiceMode wMTSServiceMode) throws Exception {
        c cVar = new c();
        cVar.a(wMTSServiceMode);
        WMTSServiceInfo execute = new b(cVar, str, userCredentials).execute();
        execute.a(str);
        return execute;
    }

    public String getTitle() {
        return this.c;
    }

    public void setTitle(String str) {
        this.c = str;
    }

    public String getAbstract() {
        return this.d;
    }

    public void setAbstract(String str) {
        this.d = str;
    }

    public String getVersion() {
        return this.e;
    }

    public void setVersion(String str) {
        this.e = str;
    }

    public List<WMTSLayerInfo> getLayerInfos() {
        return new ArrayList(this.a.values());
    }

    public WMTSLayerInfo getLayerInfo(String str) {
        return this.a.get(str);
    }

    public List<WMTSTileMatrixSet> getTileMatrixSets() {
        return new ArrayList(this.b.values());
    }

    public WMTSTileMatrixSet getTileMatrixSet(String str) {
        return this.b.get(str);
    }

    public String getServiceUrl() {
        return this.g;
    }

    public String toString() {
        return "[" + this.c + ", " + this.d + "]";
    }

    public void addLayer(String str, WMTSLayerInfo wMTSLayerInfo) {
        this.a.put(str, wMTSLayerInfo);
    }

    public void addTileMatrixSet(String str, WMTSTileMatrixSet wMTSTileMatrixSet) {
        this.b.put(str, wMTSTileMatrixSet);
    }

    public void setKVPTileRequestURL(String str) {
        this.f = str;
    }

    private void a(String str) {
        this.g = str;
    }

    private void a(WebMapLayer webMapLayer) {
        String wmtsTileMatrixSetId = webMapLayer.getWmtsTileMatrixSetId();
        this.b.put(wmtsTileMatrixSetId, new WMTSTileMatrixSet(webMapLayer.getExtent(), webMapLayer.getTileInfo(), wmtsTileMatrixSetId));
        this.a.put(webMapLayer.getWmtsLayerId(), new WMTSLayerInfo(this, webMapLayer));
    }
}
